unit Class_RttiDemo;

interface
uses
  classes,sysutils,dialogs;
type
  TRttiDemo=class(TComponent)
  private
    FX:integer;
    FY:integer;
    FStr:string;
    function GetXY:integer;
  public
    function  DoAdd(X,Y:integer):integer;
    procedure ShowMagBox;
  public
    property X:integer read FX write FX;
    property Y:integer read FY write FY;
    property Str:string read FStr write FStr;
    property XY:integer read GetXY;
  end;
implementation
uses
  Rtti;

{ TRttiDemo }

function TRttiDemo.DoAdd(X, Y: integer): integer;
begin
  Result:=X+Y;
end;

function TRttiDemo.GetXY: integer;
begin
  Result:=FX+FY;
end;

procedure TRttiDemo.ShowMagBox;
begin
  ShowMessage('The Rtti Demo');
end;

end.
